Fix new ruff errors - #179
Conversation
| def test_oscillatory(): | ||
| # Oscillatory | ||
| approx_int, err_est = quadgk(lambda x: np.sin(x), 0, np.pi) | ||
| approx_int, err_est = quadgk(np.sin, 0, np.pi) | ||
| assert err_est < 1e-10 | ||
| check("integral sin(x) from 0 to pi", approx_int, 2.0) |
There was a problem hiding this comment.
Are these tests here on purpose? Shouldn't they be in modepy/test?
There was a problem hiding this comment.
They are! I noticed this pattern in Rust code, where tests live alongside the code being tested, and rather liked it. At least for the packages where the tests live under the main package import, they're also guaranteed to be discovered. Do you not like this?
There was a problem hiding this comment.
Hm.. I don't know, can't say I have too much of a preference. The main worry is just consistency, I guess? i.e. I wouldn't have looked here for tests.
Although I'm not a big fan of these being exported by default. Does pytest not find them if they're not in __all__?
There was a problem hiding this comment.
Does pytest not find them if they're not in
__all__?
I didn't see an __all__ that mentions them. Or do you mean "we should define one that omits them"?
|
Thx! |
No description provided.